Generate one schema-correct migration for AMI and GCE image updates#37
Open
furkansahin wants to merge 1 commit into
Open
Generate one schema-correct migration for AMI and GCE image updates#37furkansahin wants to merge 1 commit into
furkansahin wants to merge 1 commit into
Conversation
The GCE migration step filtered pg_gce_image on gcp_project_id, a column that does not exist (the GCE project lives in clover config, not the table), so every generated image-update PR failed setup_database with PG::UndefinedColumn. The AWS and GCE updates were also written as two separate migration files per run. Merge the two steps into one that emits a single update_postgres_images migration covering both tables. The pg_gce_image update filters on arch alone, which uniquely identifies the row. Previous GCE image names are discovered from earlier migration files the same way old AMI ids already were, making the GCE half reversible instead of raising unconditionally; the down still raises if no prior name could be found. Empty inputs produce empty arrays, so partial builds (AMI-only or GCE-only) generate a valid no-op section instead of a missing file. Verified by executing the generation script against the real clover migrate directory: old-name discovery found the genuine 20260429-1-0 GCE images and existing AMI ids, and the emitted file passes ruby -c and clover rubocop in both the populated and empty-input paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The GCE migration step filtered pg_gce_image on gcp_project_id, a
column that does not exist (the GCE project lives in clover config,
not the table), so every generated image-update PR failed
setup_database with PG::UndefinedColumn. The AWS and GCE updates were
also written as two separate migration files per run.
Merge the two steps into one that emits a single
update_postgres_images migration covering both tables. The
pg_gce_image update filters on arch alone, which uniquely identifies
the row. Previous GCE image names are discovered from earlier
migration files the same way old AMI ids already were, making the
GCE half reversible instead of raising unconditionally; the down
still raises if no prior name could be found. Empty inputs produce
empty arrays, so partial builds (AMI-only or GCE-only) generate a
valid no-op section instead of a missing file.
Verified by executing the generation script against the real clover
migrate directory: old-name discovery found the genuine 20260429-1-0
GCE images and existing AMI ids, and the emitted file passes ruby -c
and clover rubocop in both the populated and empty-input paths.